package com.publishSubscribe;

import java.util.ArrayList;
import java.util.List;

public abstract class Subject {
	private List<Observer> observers = new ArrayList<Observer>();

	public void attach(Observer ob) {
		observers.add(ob);
	}

	public void detach(Observer ob) {
		observers.remove(ob);
	}

	public  void notifys() {

		for (Observer ob : this.observers) {
			
			ob.update();
		}
		
		
	}
}
